package model

import (
	"github.com/go-xorm/core"
	"github.com/go-xorm/xorm"
	_ "github.com/mattn/go-sqlite3"
)

var engine *xorm.Engine

func NewEngine() {
	var err error
	engine, err = xorm.NewEngine("sqlite3", "./z.db")
	engine.SetMapper(core.SameMapper{})
	engine.ShowSQL = true
	engine.ShowDebug = true
	engine.ShowErr = true
	engine.ShowWarn = true
	if err != nil {
		println(err.Error())
		return
	}
}
